CxTrend Methods

The CxTrend object contains the following methods:

AboutBox

The AboutBox method displays an About dialog box for the control.

Syntax

AboutBox()

Example

The following examples launch an About dialog box for the control.

Copy
AboutBox
Sub ShowAboutBox()
 
    <Object>.AboutBox
 
End Sub

Sub ButtonTool_EventClick()

    Dim This : Set This = ButtonTool
    <Object>.AboutBox
 
End Sub

Back to top

AddSeriesDialog

The AddSeriesDialog method calls the Series dialog box where you can add a new series to your trend.

Syntax

AddSeriesDialog()

Back to top

Cancel

The Cancel method closes an object and TheView.

Syntax

Cancel()

Back to top

ClearNoteSelection

ClearNoteSelection clears every note label selection in a Trend Tool.

Syntax

ClearNoteSelection()

Back to top

DeleteAllSeries

The DeleteAllSeries method removes all series from a trend.

Syntax

DeleteAllSeries()

Back to top

DeleteSeries

The DeleteSeries method clears trend selection(s) from a check list that was created by using the Microsoft ListView control.

Syntax

DeleteSeries()as Boolean

Remarks

This method returns a Boolean value.

Back to top

DisplayedToConfiguredAxis

Returns the configured (XML) axis index number for a given displayed axis index number.

Syntax

DisplayedToConfiguredAxis() As Integer

Back to top

EditAxesDialog

The EditAxesDialog method calls the Axis Configuration dialog where you can edit an axis in the trend.

Syntax

EditAxesDialog() As Boolean

Remarks

Returns true if saved.

Back to top

EditSeriesDialog

The EditSeriesDialog method calls the Series dialog box where you can edit a series in the trend.

Syntax

EditSeriesDialog()

Remarks

Returns 1 if refresh; 2 if restart recommended.

Back to top

Export

The Export method exports the contents of the grid to a temporary CSV file and opens the file with the default spreadsheet viewer for the user to view and save to disk.

See also Exporting Trends.

Syntax

Export()

Back to top

ExportAsImage

The ExportAsImage method allows export of an image of a trend.

See also Exporting Trends.

Syntax

ExportAsImage(ByVal nImageType As Long, ByVal path As String, ByVal canOverwrite As Boolean)As Boolean

Parameters

Parameter Required Description

nImageType

Yes

File type of image as number. The only allowable values are:

  • 0: .jpg
  • 1: .png
  • 2: .bmp

path

Yes

Target destination of exported image.

canOverwrite

Yes

Overwrites image at target destination (true) or does not overwrite image at target destination (false) and returns false.

Example

Copy

ExportAsImage

Sub ButtonTool1_EventClick()
Dim This : Set This = ButtonTool1
    Dim success
    success = Trend1.X.ExportAsImage (0, "C:\My\Path\Downloads\asdf.jpeg", True)
    If Not (success) Then
        msgbox "save asdf.jpeg failed"
    End If
    success = Trend1.X.ExportAsImage (1, "C:\My\Path\Downloads\asdf.png", True)
    If Not (success) Then
        msgbox "save asdf.png failed"
    End If
    success = Trend1.X.ExportAsImage (2, C:\My\Path\Downloads\asdf.bmp", False)
    If Not (success) Then
        msgbox "save asdf.bmp failed"
    End If
 
End Sub

Back to top

GetAlarmLimitInfoXml

The GetAlarmLimitInfoXml method returns an XML string of the trend’s alarm limit configuration.

Syntax

GetAlarmLimitInfoXml() As String

Back to top

GetAxisById

The GetAxisById method returns the configured (XML) axis index number for a given axis ID number.

Syntax

GetAxisById()

Back to top

GetDisplayedNotes

GetDisplayedNotes returns an array of DisplayNote objects that are currently displayed in the view window of the Trend Tool.

Syntax

GetDisplayedNotes() As Variant

Remarks

Returns an array of DisplayNote objects that are currently displayed on the Trend Tool.

Back to top

GetSelectedAlarmLimitSeries

The GetSelectedAlarmLimitSeries method returns an index of series currently selected to have its alarm limits displayed.

Syntax

GetSelectedAlarmLimitSeries() As Short

Back to top

GetSelectedNote

The GetSelectedNote method returns the SITE.SERVICE~NOTENUMBER of the currently selected note label. The database key (DbKey) for the note with no preceding zeroes makes up NOTENUMBER.

Syntax

GetSelectedNote() As String

Remarks

This method returns the SITE.SERVICE~NOTENUMBER of the selected note. If no note is selected, the method returns an empty string.

Back to top

GetTemplateXml

The GetTemplateXml method returns properties in XML format without Point Tag specifiers.

Syntax

GetTemplateXml() As String

Back to top

GetValuesAtTime

The GetValuesAtTime method returns the value of a series at a time slice.

Syntax

GetValuesAtTime(DATE TimeSlice)

Parameters

Parameter Required Description

DATE

Yes

The date of the time slice.

TimeSlice

Yes

Value, date, and time of a plotted point.

Back to top

Maximize

The Maximize method maximizes the trend. When entering maximization mode, the Maximize parameter value passed in is "True." When exiting maximization mode, the Maximize parameter value passed in is "False."

Syntax

Maximize()

Parameters

Parameter Required Description

True

Yes

Value passed in when entering maximization mode.

False

Yes

Value passed in when exiting maximization mode.

Back to top

Print

The Print method prints the contents of the control, grid, or viewer. When this method is called, the Print dialog box is shown to allow configuration.

Syntax

Print()

Back to top

PrintToDefaultPrinter

The PrintToDefaultPrinter method prints a trend grid to the default printer.

Syntax

PrintToDefaultPrinter()

Back to top

ReadFromFile

The ReadFromFile method reads the trend from a file.

Syntax

ReadFromFile(FileName As String) As Boolean

Parameters

Parameter Required Description

FileName

Yes

Name of the file from which the trend will be read.

Back to top

Refresh

The Refresh method refreshes the contents of the control from the Current Value Service (CVS).

Syntax

Refresh()

Back to top

Restart

For objects, the Restart method stops and restarts Run mode. For TheFrame/TheView, the Restart method restarts TheView with new site, service, and facility information, if applicable. See also RestartSoft.

Syntax

Restart()

Back to top

ScrollBackward

The ScrollBackward method scrolls the data window backward through trend time.

Syntax

ScrollBackward()

Back to top

ScrollForward

The ScrollForward method scrolls the data window forward through trend time.

Syntax

ScrollForward()

Back to top

SelectNote

SelectNote selects a note item in the Trend Tool. Both this method and the Note Feed Tool method SetSelection must be called in order for a Trend Tool and a Note Feed Tool to synchronize. This method fires this tool's EventNoteSelected event.

Syntax

SelectNote(NoteTag As String, SelectionState As Boolean)

Parameters

Parameter Required Description

NoteTag

Yes

Returns the unique identifier of the selected note in the format SITE.SERVICE~NOTENUMBER.

SelectionState

Yes

Returns a Boolean value that indicates that a note label is selected (True) or cleared (False).

Remarks

This method returns a Boolean value that indicates that selection was successful (True) or unsuccessful (False).

Back to top

SetAlarmLimitInfoXml

The SetAlarmLimitInfoXml method sets the trend’s alarm limit configuration XML string.

Syntax

SetAlarmLimitInfoXml (NewXml As String)

Parameters

Parameter Required Description

NewXml

Yes

Sets new XML string of alarm limit configurations.

Back to top

SetMaximizedCheck

The SetMaximizedCheck method sets the check next to the Maximized context menu item.

Syntax

SetMaximizedCheck(MaximizedCheck As Boolean)

Parameters

Parameter Required Description

MaximizedCheck

Yes

Sets the check next to the Maximized context menu.

Back to top

SetSelectedAlarmLimitSeries

The SetSelectedAlarmLimitSeries method changes or sets the series for which to display alarm limits.

Syntax

SetSelectedAlarmLimitSeries (NewIndex As Short)

Parameters

Parameter Required Description

NewIndex

Yes

Sets the index to the new series to display alarm limits.

Back to top

UseCygNetMaximize

The UseCygNetMaximize method uses the CygNet version of maximize instead of ProEssentials.

Syntax

UseCygNetMaximize()

Back to top

WriteToFile

The WriteToFile method writes the trend to a file.

Syntax

WriteToFile(FileName As String) As Boolean

Parameters

Parameter Required Description

FileName

Yes

The name of the file to which the trend will be written.

Back to top